<template>
  {{ msg }}
  <button data-aid="world" @click="handleClick('Vue', $event)">
    事件对象按钮
  </button>
</template>

<script>
import { reactive, toRefs } from 'vue'

export default {
  setup () {
    const state = reactive({
      msg: 'helllo'
    })

    const handleClick = (argp, e) => {
      state.msg = state.msg + argp + e.srcElement.dataset.aid
      e.srcElement.style.background = 'red'
    }
    return {
      ...toRefs(state),
      handleClick
    }
  }
}
</script>
